////////////////////////////////////////////////////////////////////////////////
// Copyright 2007 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   CATALOG_SECURITY
// AUTHOR           :   Saint Peng 
// DATE CREATE      :   2007/03/29
// DESCRIPTION      :   a COMMON VALIDATOR file for the function, CATALOG_SECURITY
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// 2007/03/29   Saint Peng      1.0                 source is generated.
//
//
//
////////////////////////////////////////////////////////////////////////////////

package com.erp.app.catalog.catalogSecurity.web;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.erp.framework.controller.form.SimpleValidator;
import com.erp.framework.model.schema.TableSchema;

/**
* <p>A <strong>Common Validator</strong> provides validations to
* the user inputs on the web forms.
*
* @author          Saint Peng 
* @version 1.0     2007/03/29
* @since           FrameWork 1.1
*
*/
public class CatalogSecurityCommonValidator extends SimpleValidator {

//	The following classes can be used to access common utilities and delegate functions.
//	private CatalogSecurityCommonUtil util = new CatalogSecurityCommonUtil();
//	private CatalogSecurityCommonDelegate dg = new CatalogSecurityCommonDelegate();

	public void validateSearch(ActionErrors errors, ActionForm formIn) {

		CatalogSecuritySearchForm form = (CatalogSecuritySearchForm)formIn;
		TableSchema ts = form.getTs();

	}

	public void validateSave(ActionErrors errors, ActionForm formIn) {

		CatalogSecurityMaintenanceForm form = (CatalogSecurityMaintenanceForm)formIn;

		validateHdr(errors, form);
		validateDtl(errors, form);
		validateParts(errors, form);
		validateSchedule(errors, form);
		validateCharges(errors, form);
		validateTask(errors, form);

	}

	public void validateHdr(ActionErrors errors, CatalogSecurityMaintenanceForm form) {

		TableSchema ts = form.getTs();
		String tabName = ts.getTabLabelByObjectId("LBL_TAB_HDR");

	}

	public void validateDtl(ActionErrors errors, CatalogSecurityMaintenanceForm form) {

		ArrayList dtlRowList = form.getMultiRows(CatalogSecurityMaintenanceAction.TAB_IDX_DTL);
		TableSchema dtlTs = form.getChildTs()[CatalogSecurityMaintenanceAction.TAB_IDX_DTL];
		String tabName = form.getTs().getTabLabelByObjectId("LBL_TAB_DTL");

	}

	public void validateParts(ActionErrors errors, CatalogSecurityMaintenanceForm form) {

		//ArrayList partsRowList = form.getMultiRows(CatalogSecurityMaintenanceAction.TAB_IDX_PARTS);
		//TableSchema partsTs = form.getChildTs()[CatalogSecurityMaintenanceAction.TAB_IDX_PARTS];
		//String tabName = form.getTs().getTabLabelByObjectId("LBL_TAB_PARTS");

	}

	public void validateSchedule(ActionErrors errors, CatalogSecurityMaintenanceForm form) {

		//ArrayList schRowList = form.getMultiRows(CatalogSecurityMaintenanceAction.TAB_IDX_SCHEDULE);
		//TableSchema schTs = form.getChildTs()[CatalogSecurityMaintenanceAction.TAB_IDX_SCHEDULE];
		//String tabName = form.getTs().getTabLabelByObjectId("LBL_TAB_SCH");

	}

	public void validateCharges(ActionErrors errors, CatalogSecurityMaintenanceForm form) {

		//ArrayList chargesRowList = form.getMultiRows(CatalogSecurityMaintenanceAction.TAB_IDX_CHARGES);
		//TableSchema chargesTs = form.getChildTs()[CatalogSecurityMaintenanceAction.TAB_IDX_CHARGES];
		//String tabName = form.getTs().getTabLabelByObjectId("LBL_TAB_CHG");

	}

	public void validateTask(ActionErrors errors, CatalogSecurityMaintenanceForm form) {

		//ArrayList taskRowList = form.getMultiRows(CatalogSecurityMaintenanceAction.TAB_IDX_TASK);
		//TableSchema taskTs = form.getChildTs()[CatalogSecurityMaintenanceAction.TAB_IDX_TASK];
		//String tabName = form.getTs().getTabLabelByObjectId("LBL_TAB_TASK");

	}

	public void moreValidateSearch(ActionMapping mapping, ActionForm formIn,
		HttpServletRequest request, HttpServletResponse response, ActionErrors errors) {

	}

	public void moreValidateSave(ActionMapping mapping, ActionForm formIn,
		HttpServletRequest request, HttpServletResponse response, ActionErrors errors) {

	}

}
